package homework_six;

public class Circle extends Shape {
    private final double Pi = 3.14;
    private double radius;

    public Circle() {
    }

    public Circle(String color, double radius) {
        super(color);
        this.radius = radius;
    }

    public double getArea() {
        return (double) Math.round(Pi * radius * radius*100)/100;
    }

    public double getPer() {
        return (double)Math.round( Pi * radius * 2*100)/100;
    }

    public void showAll() {
        System.out.println("图形类型 ：" + "Circle");
        System.out.println("颜色    ：" + getColor());
        System.out.println("半径    ：" + radius);
        System.out.println("周长    ：" + getPer());
        System.out.println("面积    ：" + getArea());
        System.out.println(" ");
    }
}
